﻿package  {
	import flash.media.Sound;
	import flash.media.SoundChannel;
	import flash.media.SoundTransform;
	import flash.events.Event;
	
	public class XSound extends Sound {
		
		private var channel:SoundChannel;
		private var transf:SoundTransform;
		private var playing:Boolean = false;
		
		public function XSound() {
			super();
			this.channel = new SoundChannel();
			this.transf = new SoundTransform();
		}
				
		public function Play(repeats:int = 0, offset_ms:int = 0, last_stop:Boolean = true):void
		{
			if(last_stop)
				this.channel.stop();
			this.channel = this.play(offset_ms,repeats, this.transf);
		}
		
		public function Stop():void
		{
			this.channel.stop();
		}

	}
	
}
